#ifndef LIFT_H
#define LIFT_H

#include "AnalogChannel.h"

class SpeedController;

class Lift
{
public:	
	Lift(unsigned int leftMotorChannel, unsigned int rightMotorChannel, unsigned int heightChannel,
				bool invertLeft = false, bool invertRight = false, int heightLeeway = 10);
	~Lift(void);
	
	void SetLimits(int maxHeight, int minHeight);
	void DriveTo(int height);
	void ManualDrive(float speed);
	signed int GetCurrentHeight(void);
	bool IsAt(signed int height);

private:	
	static const float kLiftValue    =  0.5f;
	static const float kNeutralValue =  0.0f;
	static const float kDropValue    = -0.5f;
	
	signed int m_maxHeight;
	signed int m_minHeight;
	
	AnalogChannel *m_armHeight;
	
	bool m_invertLeft;
	bool m_invertRight;
	int  m_heightLeeway;
	int  m_targetHeight;
	
	SpeedController *m_leftMotor;
	SpeedController *m_rightMotor;
	
	bool isNearEnough();
	void setMotors(float value);
};

#endif//LIFT_H
